// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import FastClick from 'fastclick'
import 'minireset.css'
import './assets/css/font-awesome.min.css'
import 'mint-ui/lib/style.css'
// import { Field, Actionsheet, MessageBox, Indicator } from 'mint-ui'
import { Field, Actionsheet, Button, Search, Header} from 'mint-ui'
// import request from './api/request'
// import auth from './api/auth'
// import qs from 'qs'
// import wx from 'wx'

// request.setConfig({
//   baseUrl: 'http://activity.eventsboom.com',
//   // baseUrl: 'http://192.168.1.17:8085',
//   beforeSuccess (res, resolve, reject) {
//     if (res.data.code === 200) {
//       resolve(res.data.data)
//     } else {
//       // || res.data.code === 500
//       if (res.data.code === 403) {
//         MessageBox.alert(res.data.errMsg).then(() => {
//           auth()
//         })
//       } else if (res.data.code === 201) {
//         reject(res.data)
//         Indicator.close()
//       } else {
//         MessageBox.alert(res.data.errMsg)
//         reject(res.data)
//         Indicator.close()
//       }
//     }
//   },
//   beforeError (_, reject) {
//     MessageBox.alert('网络连接错误')
//     Indicator.close()
//     reject()
//   }
// })
Vue.component(Field.name, Field)
Vue.component(Actionsheet.name, Actionsheet)
Vue.component(Button.name, Button)
Vue.component(Search.name, Search);
Vue.component(Header.name, Header);

Vue.config.productionTip = false

FastClick.attach(document.body)

// request('http://wechat.mypeugeot.com.cn/wxapi/Home/index/getJsInfo', 'post', qs.stringify({
//   'public_key': '8vx2j8j78hykyr7npm9q76r8wt9u6duk',
//   'secret_key': '8ed6a8a147c83e8e9205f20701c1ebc3',
//   'url': encodeURIComponent(location.href.split('#')[0]),
//   'project_name': '聚合平台'
// }), null, true).then((data) => {
//   wx.ready(function () {
//     wx.hideOptionMenu()
//     wx.showMenuItems({
//       menuList: ['menuItem:share:appMessage', 'menuItem:share:timeline']
//     })
//     wx.onMenuShareTimeline({
//       title: '蓝色关爱，盛夏好礼',
//       link: 'http://m.mypeugeot.com.cn/activity/meteor/index.html',
//       imgUrl: 'http://m.mypeugeot.com.cn/activity/question/image/biaozhi.png',
//       success: () => {
//       },
//       cancel: () => {
//       }
//     })
//     wx.onMenuShareAppMessage({
//       title: '蓝色关爱，盛夏好礼',
//       desc: '东风标致狮友汇，流星雨风暴来袭',
//       link: 'http://m.mypeugeot.com.cn/activity/meteor/index.html',
//       imgUrl: 'http://m.mypeugeot.com.cn/activity/question/image/biaozhi.png',
//       success: () => {
//       },
//       cancel: () => {
//       }
//     })
//     /* eslint-disable no-new */

// new Vue({
//   el: '#app',
//   router,
//   components: { App },
//   template: '<App/>'
// })

//   })
//   wx.config({
//     debug: false,
//     appId: data.appId,
//     timestamp: data.timestamp,
//     nonceStr: data.nonceStr,
//     signature: data.signature,
//     jsApiList: [
//       'onMenuShareTimeline', 'onMenuShareAppMessage', 'showMenuItems', 'hideOptionMenu'
//     ]
//   })
// })
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
